//package com.dataseek.iot.mqtt.demo;
//
//import com.dataseek.iot.mqtt.callback.DefaultCallback;
//import com.dataseek.iot.mqtt.demo.impl.MQTTConnector;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.ApplicationListener;
//import org.springframework.context.event.ContextRefreshedEvent;
//import org.springframework.stereotype.Component;
//
///**
// * @author cc
// * @Title: MQTT服务监听
// * @Description: MQTT服务监听
// * @date 2021/8/273:05 下午
// * @since 1.0
// */
//@Slf4j
//@Component
//public class MQTTListener implements ApplicationListener<ContextRefreshedEvent> {
//
//    @Value("${mqtt.username}")
//    private String username;
//
//    @Value("${mqtt.password}")
//    private String password;
//
//
//
//    private final MQTTConnector server;
//
//    private final DefaultCallback defaultCallback;
//
//    @Autowired
//    public MQTTListener(MQTTConnector server, DefaultCallback defaultCallback){
//        this.server = server;
//        this.defaultCallback = defaultCallback;
//    }
//
//
//    @Override
//    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
////        try {
////            server.setMqttClient(username, password, defaultCallback);
////            server.sub();
////        } catch (MqttException e) {
////            log.error(e.getMessage(), e);
////        }
//    }
//}
